<?php
namespace Admin\Controller;
use Think\Controller;
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/8
 * Time: 18:03
 */
class CheckController extends Controller{
    public function auth (){
        $mid = I ('post.mid', '');
        $uid = I ('post.uid', '');
        if (empty ($mid) || empty ($uid)){
            exit (json_encode( array ('state'=>-1,'msg'=>' ! empty')));
        }
        $roleMOD = D ('role');
        if ($roleMOD->check_auth ($mid, $uid)){
            $data = array (
                'state' => 1,
                'msg' => 'pass',
            );
        } else{
            $data = array (
                'state' => -1,
                'msg' => '你没有访问权限',
            );
        }
        exit (json_encode ($data));
    }
}